package com.xiguaji.tiktok.v1.user.repository;

import com.xiguaji.tiktok.v1.user.model.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends CrudRepository<User,Long> {

    User findUserByEmailAndPasswordAndActivation(String email, String password, Boolean active);

    User findUserByEmailAndPassword(String email, String password);

    User findUserByEmail(String email);

    List<User> getUserListByParentIdOrderByCreateTimeDesc(Long parentId);

    int countByParentId(long parentId);
}
